import 'package:logger/logger.dart';

///@date:  2023-10-24 10:19
///@author:  MuFeng
///@description:  日志打印
class LogUtils {

  LogUtils._();

  static Logger _logger = Logger();

  static void init(Logger? logger) {
    if (logger != null) {
      _logger = logger;
    }
  }

  static void v(
    dynamic msg, {
    DateTime? time,
    Object? error,
    StackTrace? stackTrace,
  }) {
    _logger.t(msg);
  }

  static void d(
    dynamic msg, {
    DateTime? time,
    Object? error,
    StackTrace? stackTrace,
  }) {
    _logger.d(msg);
  }

  static void i(
    dynamic msg, {
    DateTime? time,
    Object? error,
    StackTrace? stackTrace,
  }) {
    _logger.i(msg);
  }

  static void w(
    dynamic msg, {
    DateTime? time,
    Object? error,
    StackTrace? stackTrace,
  }) {
    _logger.w(msg);
  }

  static void e(
    dynamic msg, {
    DateTime? time,
    Object? error,
    StackTrace? stackTrace,
  }) {
    _logger.e(msg);
  }
}
